﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    /// <summary>
    /// 借款人信息表
    /// </summary>
    public class Loan_InfoDal : BaseDal<EALoan_Info>
    {
        public override string tablename
        {
            get { return "EALoan_Info"; }
        }

        public override Dictionary<string, bool> PKName
        {
            get {
                Dictionary<string, bool> dic = new Dictionary<string, bool>();
                dic.Add("loan_Id", true);
                return dic;
            }
        }

        /// <summary>
        /// 登记借款人信息
        /// </summary>
        /// <param name="loan"></param>
        /// <returns></returns>
        public bool LoanAdd(EALoan_Info loan)
        {
            //string Sql = Common.Common.ToAddSql<EALoan_Info>(loan, tablename, PKName);
            string Sql = @"insert into [dbo].[EALoan_Info] 
(loan_Name,loan_IdCard,loan_TEL,loan_ContactsTEL,loan_Contacts,createTime,create_People,
projectNumber) values ('"+loan.loan_Name+"','"+loan.loan_IdCard+"','"+loan.loan_TEL
+"','"+loan.loan_ContactsTEL +"','"+loan.loan_Contacts+"','"+loan.createTime
+"','"+loan.create_People+"','"+loan.projectNumber+"')";

            return Common.DBHelp.GetExecuteNonQuery(Sql);
        }
    }
}
